<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .Echarts_box {
            width: 1000px;
            height: 500px;
        }
    </style>
    <script src="../lib/echarts.js"></script>
</head>

<body>
    <div class="Echarts_box">
    </div>
    <script>
        var myEcharts = echarts.init(document.querySelector('.Echarts_box'))
        var option = {
            title: {
                text: '年度销量',
            },


            xAxis: {
                type: 'category',
                data: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
                boundaryGap: false
            },
            yAxis: {
                type: 'value',
                // scale: true
            },
            series: [
                {
                    name: '销售量 ',
                    type: 'line',
                    data: [1180, 1000, 1003, 1009, 1003, 1008, 1029, 1028, 1104, 1028, 1103, 1001],
                    stack: 'all',
                    label: {
                        show: true,
                        position: 'inside',
                    },
                    markPoint: {
                        data: [
                            {
                                type: 'max',
                                mame: '最大值'
                            },
                            {
                                type: 'min',
                                name: '最小值'
                            }
                        ]
                    },
                    markLine: {
                        data: [
                            {
                                type: 'average',
                                name: '平均值'
                            }
                        ]
                    },
                    markArea: {
                        data: [
                            [
                                {
                                    xAxis: '一月'
                                },
                                {
                                    xAxis: '三月'
                                }
                            ],
                            [
                                {
                                    xAxis: '五月'
                                },
                                {
                                    xAxis: '九月'
                                }
                            ]
                        ]
                    },
                    smooth: true,
                    lineStyle: {
                        color: 'red',
                        type: 'dashed'
                    },
                    areaStyle: {}
                    
                },
                {
                    name: '分数',
                    type: 'line',
                    data: [1080, 1010, 1103, 1019, 1023, 1058, 929, 928, 1004, 1088, 1103, 1101],
                    stack: 'all',
                    label: {
                        show: true,
                        position: 'inside',
                    },
                    markPoint: {
                        data: [
                            {
                                type: 'max',
                                mame: '最大值'
                            },
                            {
                                type: 'min',
                                name: '最小值'
                            }
                        ]
                    },
                    markLine: {
                        data: [
                            {
                                type: 'average',
                                name: '平均值'
                            }
                        ]
                    },
                    markArea: {
                        data: [
                            [
                                {
                                    xAxis: '一月'
                                },
                                {
                                    xAxis: '三月'
                                }
                            ],
                            [
                                {
                                    xAxis: '五月'
                                },
                                {
                                    xAxis: '九月'
                                }
                            ]
                        ]
                    },
                    lineStyle: {
                        color: 'red',
                        
                    },
                    areaStyle: {}
                }
            ]
        }
        myEcharts.setOption(option)
    </script>
</body>

</html>